package sk.xorty;

import com.google.inject.Guice;
import com.google.inject.Injector;
import sk.xorty.domain.Person;
import sk.xorty.web.Model;
import sk.xorty.web.PersonController;

public class Main {

    public static void main(String[] args) {
        Injector injector = Guice.createInjector(new PersonModule());
        PersonController controller = injector.getInstance(PersonController.class);

        System.out.println("Invoking GET on controller");
        String getResponse = controller.get(new Model());
        System.out.println("Controller GET response: " + getResponse);

        Person bob = new Person("Bob", 33);
        System.out.println("Invoking POST on controller");
        String postResponse = controller.post(bob);
        System.out.println("Controller POST response: " + postResponse);
    }

}
